using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace PocketAbapa
{
	public class House : Button
	{
		public House(int index, int balls) : base()
		{
			Balls = balls;
			Index = index;
		}

		public void Enable(bool shouldEnable)
		{
			this.Enabled = shouldEnable && this.Balls > 0;
		}

		private int mIndex;
		public int Index
		{
			get
			{
				return mIndex;
			}
			set
			{
				mIndex = value;
			}
		}
		
		private int mBalls;
		public int Balls
		{
			get
			{
				return mBalls;
			}
			set
			{
				if (value >= 0 && value != mBalls)
				{
					mBalls = value;
					this.Text = mBalls.ToString();
				}
			}
		}
	}
}
